/**
 * Created by 123 on 2017/12/13.
 */
import {updateOfLngLat} from '../services/updateOfLngLat';

export default {
  namespace: 'updateOfLnglat',

  state: {},

  effects: {
    //工程现场定位
    *updateOfLngLat({payload}, {call, put}) {
      const {res, error} = yield call(updateOfLngLat, {projectId: '0ec08f2e4470466a80b2540915354b05', lngLat: ''});
      if (error) {
        yield put({type: 'updateOfLngLatFail', payload: error})
      } else {
        yield put({type: 'updateOfLngLatSuccess', payload: res})
      }
    },
  },

  reducers: {
    updateOfLngLatFail(state, {payload}) {

      return {...state,}
    },

    updateOfLngLatSuccess(state, {payload}) {
      return {...state, troubles: payload.data}
    },
  }
}
